package cn.itsource.controller.app;

import cn.itsource.pojo.ro.UserCarRo;
import cn.itsource.result.JSONResult;
import cn.itsource.service.ICustomerCarService;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

@Tag(name = "APP客户车辆",description = "客户车辆")
@RestController
@RequestMapping("/app/customerCar")
public class AppCustomerCarController {

    @Autowired
    public ICustomerCarService customerCarService;

    @GetMapping("/list")
    public JSONResult getUserCars(){
       return JSONResult.success(customerCarService.getUserCars());
    }

    @PostMapping("/add")
    public JSONResult addUserCar(@RequestBody @Valid UserCarRo userCarRo){
        customerCarService.addUserCar(userCarRo);
        return JSONResult.success();
    }
}
